package com.wangyi.im.request;

public class IMMessageQueryRequest {

    private String from;

    private String to;

    private String begintime;

    private String endtime;

    private Integer limit;

    private Integer reverse;

    private String type;

    private Long lastMsgId;


    private IMMessageQueryRequest(String from, String to, String begintime, String endtime, Integer limit, Integer reverse, String type, Long lastMsgId){
        this.from = from;
        this.to = to;
        this.begintime = begintime;
        this.endtime = endtime;
        this.limit = limit;
        this.reverse = reverse;
        this.type = type;
        this.lastMsgId = lastMsgId;
    }

    public static class Builder{

        private String from;

        private String to;

        private String begintime;

        private String endtime;

        private Integer limit;

        private Integer reverse;

        private String type;

        private Long lastMsgId;

        public IMMessageQueryRequest build(){
            return new IMMessageQueryRequest(from, to, begintime, endtime, limit, reverse, type, lastMsgId);
        }

        public Builder setFrom(String from) {
            this.from = from;
            return this;
        }

        public Builder setTo(String to) {
            this.to = to;
            return this;
        }

        public Builder setBegintime(String begintime) {
            this.begintime = begintime;
            return this;
        }

        public Builder setEndtime(String endtime) {
            this.endtime = endtime;
            return this;
        }

        public Builder setLimit(Integer limit) {
            this.limit = limit;
            return this;
        }

        public Builder setReverse(Integer reverse) {
            this.reverse = reverse;
            return this;
        }

        public Builder setType(String type) {
            this.type = type;
            return this;
        }

        public Builder setLastMsgId(Long lastMsgId) {
            this.lastMsgId = lastMsgId;
            return this;
        }
    }
}
